﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace LocationTrackingService.Common
{
    public class Utilities
    {
        static CultureInfo provider = CultureInfo.InvariantCulture;
        static string format = "dd/MM/yyyy HH:mm:ss";
        public static DateTime convertToTime(string dateString)
        {
            DateTime result = DateTime.Now;
            try
            {
                result = DateTime.ParseExact(dateString, format, provider);
            }
            catch (Exception)
            {
            }
              return result;
        }
        public static string convertDateToString(DateTime date)
        {
            string format = "dd/MM/yyyy HH:mm:ss";
            return date.ToString(format,provider);
        }
    }
}
